package com.ximu.test.annotation;

import java.lang.reflect.Method;

public class Annotation1 {

	public static void main(String[] args){
		Method[] method = Test.class.getDeclaredMethods();
		for(Method met:method){
			if(met.isAnnotationPresent(TestAnnotation.class)){
				TestAnnotation ta = met.getAnnotation(TestAnnotation.class);
				System.out.println(ta.id()+":"+ta.name());
			}
		}
	}
}

class Test{
	
	@TestAnnotation(id=1,name="test1")
	public void test1(){
	}
	
	@TestAnnotation(id=2,name="test2")
	public void test2(){
		
	}
}